﻿using System.Web.UI;

namespace Eneta.Portal.Forum.Common.Controls
{
    public class OWSNumberField : OWSBase
    {
        // Methods
        protected override void Render(HtmlTextWriter wtr)
        {
            wtr.Write("<SCRIPT>fld=new NumberField(frm, '{0}', '{1}', '{2}'); fld.fRequired = {3}; fld.wMin = \"{4}\"; fld.wMax = \"{5}\"; fld.BuildUI(); </SCRIPT>", new object[] { this.UniqueID, base.Display, base.JavaScriptValue, base.Required.ToString().ToLower(), this.Min, this.Max });
            wtr.Write("&nbsp;<br><SPAN class=ms-formdescription ID={0}>{1}</SPAN>", this.UniqueID, this.Description);
        }

        // Properties
        public string Max
        {
            get
            {
                return ("" + this.ViewState["Max"]);
            }
            set
            {
                this.ViewState["Max"] = value;
            }
        }

        public string Min
        {
            get
            {
                return ("" + this.ViewState["Min"]);
            }
            set
            {
                this.ViewState["Min"] = value;
            }
        }
    }

 

}
